{include file="/public/header"/}

<div id="container" style="overflow-y: auto;">
    <div class="col-lg-12">
        <h2 class="page-header" style="font-size: 20px;"><i class="am-icon-users"></i>  客服管理列表</h2>
    </div>   

    <div style="width: 80%;margin: 5px auto">
    	 <table class="page-table am-table am-table-bordered am-table-striped am-table-hover am-table-compact am-text-nowrap am-margin-bottom-xs am-table-centered">
            <thead>
            <tr>
                <th>用户名</th>
                <th>昵称</th>
                <th>等级</th>
                <th>网站id</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            {volist name='lister' id='admins'}
            <tr>
                <td>{$admins.user_name}</td>
                <td>{$admins.nick_name}</td>
                {if $admins.level == 'manager'}
                <td>管理员</td>
                {else}
                <td>普通客服</td>
                {/if}
                <td>{$admins.business_id}</td>
                <td>
                    <a href='javascript:mdelete({$admins.service_id})' class='am-badge am-badge-danger'> <i
                        class='am-icon-recycle'></i> 删除</a>
                </td>
            </tr>
            {/volist}
            </tbody>
        </table>
        {$page}
    </div>

 </div>

 <script>
 	var mdelete =function(id){

 		   layer.open({
            type: 1,
            title: '删除',
            area: ['260px', '180px'],
            content: "<div><center><p style='font-size:15px;margin:10px auto;'>确定删除</p><p style='color:red;'>*删除管理员等级,会删除该管理员名所有客服</p></center></div>",
            btn: ['确定', '取消'],
            yes: function () {
                $.ajax({
                    url: "/manager/set/delete",
                    type: "post",
                    data: {id: id},
                    success: function (res) {
                    	if(res){
                    	  layer.msg('删除成功！',{time:2000,end:function () {
                              location.reload();
                          }});
                    	}
                    }
                });
            }
        });
 	}
 </script>




{include file="public/footer"/}


